package com.cy.web.controller;

import com.cy.pojo.SysEmp;
import com.cy.service.SysEmpService;
import org.springframework.beans.factory.annotation.Autowired;
<<<<<<< HEAD
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.swing.text.html.parser.Entity;

@RestController
@RequestMapping("/emp")
public class SysEmpController {
    @Autowired
    private SysEmpService sysEmpService;
    @RequestMapping("/save")
    public  String doSaveEmp(SysEmp Entity){
        sysEmpService.doSaveEmp(Entity);
        return "save ok";
    }
    @RequestMapping("/doFindById/{id}")
    public SysEmp doFindById(@PathVariable Integer id){
        return sysEmpService.doSelectEmpById(id);
    }
=======
import org.springframework.web.bind.annotation.*;

import javax.sound.midi.SysexMessage;
import javax.swing.text.html.parser.Entity;
import java.util.List;

@RestController
@RequestMapping("/emp/")
public class SysEmpController {
    @Autowired
    private SysEmpService sysEmpService;
    @PostMapping()
    public  String doSaveEmp(@RequestBody SysEmp Entity){
        sysEmpService.doSaveEmp(Entity);
        return "save ok";
    }
    @GetMapping("/{id}")
    public SysEmp doFindById(@PathVariable Integer id){
        return sysEmpService.doSelectEmpById(id);
    }
    @GetMapping
    public List<SysEmp> doFindEmp(SysEmp emp){
        return sysEmpService.doSelectEmp(emp);
    }
    @DeleteMapping("/{ids}")
    public String doDeleteEmpByIds(@PathVariable List<Integer> ids){
        sysEmpService.doDeleteEmpByIds(ids);
        return "delete ok";
    }
    @PutMapping
    public int doUpdateEmp(@RequestBody SysEmp entity){
       int rows= sysEmpService.doUpdateEmp(entity);
       return rows;
    }
>>>>>>> 077350d86a1907fe0d7e568d7e4251032549d4f8
}
